$(document).ready(function() {
	$("#next").click(function() {
		switch (this.value) {
			 case "Start":
			 	$('#allit').toggle();
			 	$('#question').change().text("Why do you want to have a new website, or have your current site redesigned?"); 
				this.value="Goto Question 2";
				$('#allit').toggle('slow');
				answer1 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
				
			case "Goto Question 2": 
				$('#allit').toggle();
			 	$('#question').change().text("What will happen if you don’t have a new website, or have your current site redesigned?"); 
				this.value="Goto Question 3";
				$('#allit').toggle('slow');
				answer2 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 3": 
				$('#allit').toggle();
			 	$('#question').change().text("Please describe your organization in a few sentences."); 
				this.value="Goto Question 4";
				$('#allit').toggle('slow');
				answer3 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 4": 
				$('#allit').toggle();
			 	$('#question').change().text("What is there about you and your background that sets you apart for a special (niche) group of potential customers?"); 
				this.value="Goto Question 5";
				$('#allit').toggle('slow');
				answer4 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 5": 
			$('#allit').toggle();
			 	$('#question').change().text("What problems do your prospects have that your business solves?"); 
				this.value="Goto Question 6";
				$('#allit').toggle('slow');
				answer5 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 6": 
			$('#allit').toggle();
			 	$('#question').change().text("How can your particular work background help prospects, compared to others in your industry? What’s special about your work experience?"); 
				this.value="Goto Question 7";
				$('#allit').toggle('slow');
				answer6 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 7": 
			$('#allit').toggle();
			 	$('#question').change().text("Why do you believe site visitors should do business with you rather than with a competitor?"); 
				this.value="Goto Question 8";
				$('#allit').toggle('slow');
				answer7 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 8": 
			$('#allit').toggle();
			 	$('#question').change().text("Do you have a slogan or tagline that clearly describes what you offer in terms of benefits or features?"); 
				this.value="Goto Question 9";
				$('#allit').toggle('slow');
				answer8 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 9": 
				$('#allit').toggle();
			 	$('#question').change().text("Please describe your potential customers. Pay special attention to their income, interests, gender, age, even type of computer they use, e.g., old with dialup account or newer with broadband. If your website is a business-to-business site, what sort of companies are you hoping to attract?"); 
				this.value="Goto Question 10";
				$('#allit').toggle('slow');
				answer9 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 10": 
				$('#allit').toggle();
			 	$('#question').change().text("What is your budget for this project?"); 
				this.value="Goto Question 11";
				$('#allit').toggle('slow');
				answer10 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 11": 
				$('#allit').toggle();
			 	$('#question').change().text("Who are the decision makers on this project? What is the turnaround time for making a decision?"); 
				this.value="Goto Question 12";
				$('#allit').toggle('slow');
				answer11 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 12": 
			$('#allit').toggle();
			 	$('#question').change().text("What staff will be involved? What are their roles? Is there a webmaster on your staff?"); 
				this.value="Goto Question 13";
				$('#allit').toggle('slow');
				answer12 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 13": 
			$('#allit').toggle();
			 	$('#question').change().text("What is your deadline for completing the site?"); 
				this.value="Goto Question 14";
				$('#allit').toggle('slow');
				answer13 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 14": 
			$('#allit').toggle();
			 	$('#question').change().text("Please list the names of three other sites that you like. Why are they attractive to you?"); 
				this.value="Goto Question 15"
				$('#allit').toggle('slow');
				answer14 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 15": 
			$('#allit').toggle();
			 	$('#question').change().text("Have you researched your online competition so you have an idea of what you do and don’t want on your site?"); 
				this.value="Goto Question 16";
				$('#allit').toggle('slow');
				answer15 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 16": 
			$('#allit').toggle();
			 	$('#question').change().text("What do you NOT want on your site in terms of text, content, etc.?"); 
				this.value="Goto Question 17";
				$('#allit').toggle('slow');
				answer16 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 17": 
			$('#allit').toggle();
			 	$('#question').change().text("Where is the website content coming from? Who’s responsible for updating it? Is it ready for use on your website?"); 
				this.value="Goto Question 18";
				$('#allit').toggle('slow');
				answer17 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 18": 
			$('#allit').toggle();
			 	$('#question').change().text("Do you have a logo?"); 
				this.value="Goto Question 19";
				$('#allit').toggle('slow');
				answer18 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 19": 
			$('#allit').toggle();
			 	$('#question').change().text("Are you planning to do online sales? If so, what is the product, and how many items do you want to sell online?"); 
				this.value="Goto Question 20";
				$('#allit').toggle('slow');
				answer19 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 20": 
			$('#allit').toggle();
			 	$('#question').change().text("If you’re planning to sell online, are you set up to accept credit cards?"); 
				this.value="Goto Question 21";
				$('#allit').toggle('slow');
				answer20 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 21": 
			$('#allit').toggle();
			 	$('#question').change().text("How much time will you be able to spend online, responding to inquiries that come in via your website? Once a day? Several hours a day?"); 
				this.value="Goto Question 22";
				$('#allit').toggle('slow');
				answer21 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 22": 
			$('#allit').toggle();
			 	$('#question').change().text("If you were using a search engine, what words or phrases would you use to find your site? Which of these words or phrases is most important?"); 
				this.value="Goto Question 23";
				$('#allit').toggle('slow');
				answer22 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 23": 
			$('#allit').toggle();
			 	$('#question').change().text("Other than what search engines will produce, what methods do you have in mind to spread the word about your website?"); 
				this.value="Goto Question 24";
				$('#allit').toggle('slow');
				answer23 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 24": 
			$('#allit').toggle();
			 	$('#question').change().text("Once your website is completed, how long do you think it will be before you begin bringing in significant business from the website?"); 
				this.value="Goto Question 25";
				$('#allit').toggle('slow');
				answer24 = $('#answer').text();
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "Goto Question 25":
			$('#allit').toggle();
			 	$('#question').change().text("How do you plan to encourage repeat visitors and referrals?"); 
				this.value="submit";
				$('#allit').toggle('slow');
				document.getElementById("answer").value = "";
				document.getElementById("answer").focus();
				break;
			case "submit":
				$('#allit').toggle();
 				var answers = array(answer1, answer2, answer3, answer4, answer5, answer6, answer7, answer8, answer9, answer10,answer11, answer12, answer13, answer14, answer15, answer16, answer17, answer18, answer19, answer20, answer21, answer22, answer23, answer24, answer25);
				var serializedAnswers = serialize(answers);

$.ajax({
  url: '../processing/questions.php',
  processing_data: false,
  data: serializedAnswers,
});
this.value="done";
break;
}
});
});
function post_to_url(path, params, method) {
method = method || "post";
	var form = document.createElement("form");
	form.setAttribute("method", method);
	form.setAttribute("action", path);
	for(var key in params) {
		var hiddenField = document.createElement("input");
		hiddenField.setAttribute("type", "hidden");
		hiddenField.setAttribute("name", key);
		hiddenField.setAttribute("value", params[key]);
		form.appendChild(hiddenField);
	}
	document.body.appendChild(form);
	form.submit();
}
// this is a change